package com.cn.sys.main.web.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.cn.sys.main.entity.SysModule;

public class ModuleValidator implements Validator {

	
	public boolean supports(Class<?> clazz) {
		
		return clazz.equals(SysModule.class);
	}

	
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "moduleName", "sys.module.moduleName", "模块名称不能为空");
	}

}
